﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Traductor
{
   public class Cadenas
    {
       
       String temp = "";

       public Cadenas(String temporal)
       {
           this.temp=temporal;
           
           
       }

       
       public String CalcularAscii(String cad)
       {
           
           byte[] array = Encoding.ASCII.GetBytes(cad);
           // se viene desde mem[temp] = cod ascii
           cad = "mem[" + temp + "] ="+ array[0]+";\n";


           for (int i = 1; i < array.Length; i++)
           {
               cad += "m=m+1;\n";
               cad += "mem[m]=" + array[i] + ";\n";
           }
           cad += "m=m+1\nmem[m]=0; // fin cadena";
           Console.WriteLine(cad);
           return cad;
       }

    }
}
